package com.holdtime.jtt809.taxi.module.entity.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.holdtime.jtt809.taxi.module.entity.LocationNewDO;
import com.holdtime.jtt809.taxi.module.model.vo.LocationNewPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 车辆定位信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface LocationNewMapper extends BaseMapperX<LocationNewDO> {

    default PageResult<LocationNewDO> selectPage(LocationNewPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LocationNewDO>()
                .eqIfPresent(LocationNewDO::getVehicleColor, reqVO.getVehicleColor())
                .betweenIfPresent(LocationNewDO::getUploadTime, reqVO.getUploadTime())
                .eqIfPresent(LocationNewDO::getLon, reqVO.getLon())
                .eqIfPresent(LocationNewDO::getLat, reqVO.getLat())
                .eqIfPresent(LocationNewDO::getSps, reqVO.getSps())
                .eqIfPresent(LocationNewDO::getDrs, reqVO.getDrs())
                .eqIfPresent(LocationNewDO::getMileage, reqVO.getMileage())
                .eqIfPresent(LocationNewDO::getDirection, reqVO.getDirection())
                .eqIfPresent(LocationNewDO::getAltitude, reqVO.getAltitude())
                .eqIfPresent(LocationNewDO::getState, reqVO.getState())
                .eqIfPresent(LocationNewDO::getAlarm, reqVO.getAlarm())
                .orderByDesc(LocationNewDO::getUploadTime));
    }

}